package com.zyh.fengzhuanghejichengzuoye.test2.domain;

public class Cylinder extends Circle{
    private double height;

    //构造方法
    public Cylinder(double r, double h) {
        super(r);
        this.height = h;
    }

    //成员方法
    //圆柱体体积
    public double getVolume(){
        return Math.PI*Math.pow(getRadius(),2)*getHeight();
    }
    //show()
    public void showVolume(){
        System.out.println("圆柱体的体积："+getVolume());
    }

    //getter and setter

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}
